<template lang="pug">
div
  .ui.grid.equal.width
    .column(v-if="report.category === 'pq'")
      .ui.header 基本信息
      table.ui.celled.table
        tbody
          tr
            td 姓名: {{report.name}}
            td 性别: {{report.gender | gender}}
            td 手机号: {{report.phone}}
            td 验光时间: {{report.measured_at | unixToDate 'YYYY-MM-DD HH:mm:ss'}}
      .ui.header 问诊
      table.ui.celled.table(v-if="report.content")
        tbody
          tr
            td 出生年月: {{report.content['问诊']['出生年月'] | unixToDate 'YYYY-MM-DD'}}
            td 职业: {{report.content['问诊']['职业']}}
            td 经常开车: {{report.content['问诊']['经常开车'] | reportjckc}}
          tr
            td 原镜使用时间: {{report.content['问诊']['原镜使用时间']}}
            td 原镜清晰度: {{report.content['问诊']['原镜清晰度'] | reportyjqxd}}
            td 佩戴隐形眼镜: {{report.content['问诊']['佩戴隐形眼镜'] | reportpeyj}}
          tr
            td(colspan="3") 相关病史: {{report.content['问诊']['相关病史']}}
          tr
            td(colspan="3") 用户陈述: {{report.content['问诊']['用户陈述']}}
      br
      .ui.grid.equal.width
        .column
          .ui.header 手持电脑验光
        .column
          .ui.grid.equal.width
            .column
              .ui.header 原镜测量
            .column.right.aligned
              | {{report.content['原镜测量']['眼镜类型']}}
              //- input#frame(type="radio", name="test", value="框架眼镜")
              //- label(for="frame")  框架眼镜
              //- input#contact(type="radio", name="test", value="隐形眼镜")
              //- label(for="contact")  隐形眼镜
      table.ui.celled.table
        thead
          tr
            th &nbsp;
            th 球镜
            th 柱镜
            th 轴位
            th &nbsp;
            th 球镜
            th 柱镜
            th 轴位
            th 光学中心
        tbody
          tr
            td 右眼
            td {{report.content['手持电脑验光']['球镜']['右眼']}}
            td {{report.content['手持电脑验光']['柱镜']['右眼']}}
            td {{report.content['手持电脑验光']['轴位']['右眼']}}
            td 右眼
            td {{report.content['原镜测量']['球镜']['右眼']}}
            td {{report.content['原镜测量']['柱镜']['右眼']}}
            td {{report.content['原镜测量']['轴位']['右眼']}}
            td(rowspan="2") {{report.content['原镜测量']['轴位']['光学中心']}}
          tr
            td 左眼
            td {{report.content['手持电脑验光']['球镜']['左眼']}}
            td {{report.content['手持电脑验光']['柱镜']['左眼']}}
            td {{report.content['手持电脑验光']['轴位']['左眼']}}
            td 左眼
            td {{report.content['原镜测量']['球镜']['左眼']}}
            td {{report.content['原镜测量']['柱镜']['左眼']}}
            td {{report.content['原镜测量']['轴位']['左眼']}}
      .ui.header 视力和视功能检查
      table.ui.celled.table
        tbody
          tr
            td 瞳距
            td &nbsp;
            td 球镜
            td 柱镜
            td 轴位
            td 棱镜
            td 基底
            td ADD
            td 矫正视力
          tr
            td(rowspan="2") {{report.content['视力和视功能检查']['瞳距']}}
            td 右眼
            td {{report.content['视力和视功能检查']['球镜']['右眼']}}
            td {{report.content['视力和视功能检查']['柱镜']['右眼']}}
            td {{report.content['视力和视功能检查']['轴位']['右眼']}}
            td {{report.content['视力和视功能检查']['棱镜']['右眼']}}
            td {{report.content['视力和视功能检查']['基底']['右眼']}}
            td {{report.content['视力和视功能检查']['ADD']['右眼']}}
            td {{report.content['视力和视功能检查']['矫正视力']['右眼']}}

          tr
            td.border-left 左眼
            td {{report.content['视力和视功能检查']['球镜']['左眼']}}
            td {{report.content['视力和视功能检查']['柱镜']['左眼']}}
            td {{report.content['视力和视功能检查']['轴位']['左眼']}}
            td {{report.content['视力和视功能检查']['棱镜']['左眼']}}
            td {{report.content['视力和视功能检查']['基底']['左眼']}}
            td {{report.content['视力和视功能检查']['ADD']['左眼']}}
            td {{report.content['视力和视功能检查']['矫正视力']['左眼']}}
          tr
            td(colspan="4") 主视眼: {{report.content['视力和视功能检查']['主视眼']}}
            td(colspan="5") Worth 四点: {{report.content['视力和视功能检查']['Worth 四点']}}
          tr
            td(colspan="4") 立体视检查: {{report.content['视力和视功能检查']['Worth 四点']}}
            td(colspan="5") Amsler 表: {{report.content['视力和视功能检查']['Amsler 表']}}
      .ui.header 验光处方
      table.ui.celled.table
        tbody
          tr
            td(rowspan="3") 远用
              br
              | 处方
            td &nbsp;
            td 球镜
            td 柱镜
            td 轴位
            td 棱镜
            td 基底
            td 矫正视力
            td 瞳距
          tr
            td.border-left 右眼
            td {{report.content['验光处方']['远用处方']['球镜']['右眼']}}
            td {{report.content['验光处方']['远用处方']['柱镜']['右眼']}}
            td {{report.content['验光处方']['远用处方']['轴位']['右眼']}}
            td {{report.content['验光处方']['远用处方']['棱镜']['右眼']}}
            td {{report.content['验光处方']['远用处方']['基底']['右眼']}}
            td {{report.content['验光处方']['远用处方']['矫正视力']['右眼']}}
            td(rowspan="2") {{report.content['验光处方']['远用处方']['瞳距']}}
          tr
            td.border-left 左眼
            td {{report.content['验光处方']['远用处方']['球镜']['左眼']}}
            td {{report.content['验光处方']['远用处方']['柱镜']['左眼']}}
            td {{report.content['验光处方']['远用处方']['轴位']['左眼']}}
            td {{report.content['验光处方']['远用处方']['棱镜']['左眼']}}
            td {{report.content['验光处方']['远用处方']['基底']['左眼']}}
            td {{report.content['验光处方']['远用处方']['矫正视力']['左眼']}}
      table.ui.celled.table
        tbody
          tr
            td(rowspan="3") 辅助
              br
              | 处方
            td &nbsp;
            td 球镜
            td 柱镜
            td 轴位
            td 棱镜
            td 基底
            td 矫正视力
            td 瞳距
          tr
            td.border-left 右眼
            td {{report.content['验光处方']['辅助处方']['球镜']['右眼']}}
            td {{report.content['验光处方']['辅助处方']['柱镜']['右眼']}}
            td {{report.content['验光处方']['辅助处方']['轴位']['右眼']}}
            td {{report.content['验光处方']['辅助处方']['棱镜']['右眼']}}
            td {{report.content['验光处方']['辅助处方']['基底']['右眼']}}
            td {{report.content['验光处方']['辅助处方']['矫正视力']['右眼']}}
            td(rowspan="2") {{report.content['验光处方']['辅助处方']['瞳距']}}
          tr
            td.border-left 左眼
            td {{report.content['验光处方']['辅助处方']['球镜']['左眼']}}
            td {{report.content['验光处方']['辅助处方']['柱镜']['左眼']}}
            td {{report.content['验光处方']['辅助处方']['轴位']['左眼']}}
            td {{report.content['验光处方']['辅助处方']['棱镜']['左眼']}}
            td {{report.content['验光处方']['辅助处方']['基底']['左眼']}}
            td {{report.content['验光处方']['辅助处方']['矫正视力']['左眼']}}
      .ui.header 验光师建议
      .ui.segment
        ol.ui.list
          li 建议你在以下日期进行视力复查: {{report.content['验光师建议']['复查日期'] | unixToDate}}
          li 根据国际标准, 本次验光处方, 双眼矫正视力达到 {{report.content['验光师建议']['双眼矫正视力']}}
        input#frameContact(type="checkbox", v-model="report.content['验光师建议']['建议交替佩戴']", disabled=true)
        label(for="frameContact")  建议隐形眼镜和框架眼镜交替佩戴
        .ui.divider
        pre {{report.content['验光师建议']['补充']}}

      p 验光师: {{report.optometrist_name}}, {{report.measured_at|unixToDate 'YYYY-MM-DD HH:mm:ss'}}
      p 录入人: {{report.inputer_name}}, {{report.inputed_at|unixToDate 'YYYY-MM-DD HH:mm:ss'}}
      p 核对人: {{report.reviewer_name}}, {{report.reviewed_at|unixToDate 'YYYY-MM-DD HH:mm:ss'}}

    .column(v-if="report.category === 'user'")
      .ui.header 基本信息
      table.ui.celled.table
        tbody
          tr
            td 姓名: {{report.name}}
            td 性别: {{report.gender | gender}}
            td 手机号: {{report.phone}}
            td 上传时间: {{report.created_at | unixToDate}}
      .ui.header 验光处方
      table.ui.celled.table
        thead
          tr
            th &nbsp;
            th 球镜
            th 柱镜
            th 轴位
            th 矫正视力
            th 瞳距
        tbody
          tr
            td 右眼
            td {{report.content['验光处方']['球镜']['右眼']}}
            td {{report.content['验光处方']['柱镜']['右眼']}}
            td {{report.content['验光处方']['轴位']['右眼']}}
            td {{report.content['验光处方']['矫正视力']['右眼']}}
            td(rowspan="2") {{report.content['验光处方']['瞳距']}}
          tr
            td 左眼
            td {{report.content['验光处方']['球镜']['左眼']}}
            td {{report.content['验光处方']['柱镜']['左眼']}}
            td {{report.content['验光处方']['轴位']['左眼']}}
            td {{report.content['验光处方']['矫正视力']['左眼']}}
          tr
            td.no-border-right Add
            td.no-border-left {{report.content['验光处方']['Add']}}
            td.no-border-right 棱镜
            td.no-border-left {{report.content['验光处方']['棱镜']}}
            td.no-border-right 基底
            td.no-border-left {{report.content['验光处方']['基底']}}
      p 录入人: {{report.inputer_name}}, {{report.inputed_at|unixToDate 'YYYY-MM-DD HH:mm:ss'}}
      p 核对人: {{report.reviewer_name}}, {{report.reviewed_at|unixToDate 'YYYY-MM-DD HH:mm:ss'}}
    .column
      img(style="width: 100%;", v-bind:src="report.scan_picture")
</template>

<script>
export default {
  name: 'reportView',
  components: {
  },
  props: ['report'],
  vuex: {
    getters: {
    },
    actions: {}
  },
  data() {
    return {
    }
  },
  computed: {
  },
  methods: {
  },
  ready() {
    $(this.$el).find('.dropdown').dropdown({
      on: 'hover'
    })
  },
}
</script>

<style lang="sass" scoped>
</style>
